package july2;

public class Test02MaoPao {
    public static void main(String[] args) {
        int[] arr={3,4,57,2,1,1};

        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length-1-i; j++) {
                if (arr[j]>arr[j+1]) {
                    int temp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=temp;
                }
            }
        }

        for (int j : arr) {
            System.out.print(j + ",");
        }

        //选择排序
        for (int i = 0; i < arr.length; i++) {
            for (int j = i+1; j < arr.length; j++) {
                if (arr[i]>arr[j]){
                    int temp=arr[i];
                    arr[i]=arr[j];
                    arr[j]=temp;
                }
            }
        }

        for (int j:arr){
            System.out.print(j+",");
        }
    }
}
